home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
_COLORSE.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
3KB
|
80 lines
FUNCTION _ColorSet && Set Color Attributes
PARAMETERS pc_setclr
*--------------------------------------------------------------------
* NAME
* _ColorSet - Set color attributes.
*
* SYNOPSIS
* _ColorSet( pc_setclr )
*
* DESCRIPTION
* _ColorSet() will set the eight dBASE color values
* based on its string argument. Such a string
* is most commonly obtained by calling
* SET("ATTRIBUTES").
*
* PARAMETER
* pc_setclr - A string of the type returned by
* SET("ATTRIBUTES").
*
* EXAMPLES
*
* lc_prevcol = SET("ATTRIBUTES") && Save current colors
* SET COLOR TO w+/b,gr+/n && Change standard colors
* SET COLOR OF INFORMATION TO w+/r && Change INFORMATION colors
* ...
* lc_tmp = _ColorSet("lc_prevcol") && Restore colors back to before
*
* NOTES
* Note that the dBASE IV SET("ATTRIBUTES") function
* returns a string containing "&&". These ampersands
* are required for _ColorSet() to properly set the
* color values. This version is also very bullet
* susceptible.
*
* SEE ALSO
* SET("ATTRIBUTES"), _ColorChk()
*
*--------------------------------------------------------------------
PRIVATE lc_colstr, lc_colatt
*-- Pick out individual colors:
* (pc_setclr is used directly first two times for speed)
lc_colatt = SUBSTR( pc_setclr, 1, AT( "," , pc_setclr) - 1)
SET COLOR OF NORMAL TO &lc_colatt.
lc_colstr = SUBSTR( pc_setclr, AT(",", pc_setclr) + 1 )
lc_colatt = SUBSTR( lc_colstr, 1, AT( ",", lc_colstr) - 1)
SET COLOR OF HIGHLIGHT TO &lc_colatt.
lc_colstr = SUBSTR( lc_colstr, AT(",", lc_colstr) + 1 )
* Use the " && " this time instead of ",":
lc_colatt = SUBSTR( lc_colstr, 1, AT( " &", lc_colstr) - 1)
SET COLOR TO ,,&lc_colatt. && No PERIMITER keyword.
* Use the " && " instead of "," here:
lc_colstr = SUBSTR( lc_colstr, AT(" &", lc_colstr) + 4 )
lc_colatt = SUBSTR( lc_colstr, 1, AT( ",", lc_colstr) - 1)
SET COLOR OF MESSAGES TO &lc_colatt.
lc_colstr = SUBSTR( lc_colstr, AT(",", lc_colstr) + 1 )
lc_colatt = SUBSTR( lc_colstr, 1, AT( ",", lc_colstr) - 1)
SET COLOR OF TITLES TO &lc_colatt.
lc_colstr = SUBSTR( lc_colstr, AT(",", lc_colstr) + 1 )
lc_colatt = SUBSTR( lc_colstr, 1, AT( ",", lc_colstr) - 1)
SET COLOR OF BOX TO &lc_colatt.
lc_colstr = SUBSTR( lc_colstr, AT(",", lc_colstr) + 1 )
lc_colatt = SUBSTR( lc_colstr, 1, AT( ",", lc_colstr) - 1)
SET COLOR OF INFORMATION TO &lc_colatt.
lc_colstr = SUBSTR( lc_colstr, AT(",", lc_colstr) + 1 )
SET COLOR OF FIELDS TO &lc_colstr.
RETURN .T.
*-- EOF: _ColorSet( pc_setclr )